package lijun;

public class Undergraduate extends Student{
    private String major;

    public Undergraduate() {
        this.major = "";
    }

    public Undergraduate(String name, String sex, int age, String stuNo, String major) throws Exception {
        super(name, sex, age, stuNo);
        this.major = major;
    }

    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }

    @Override
    public String toString() {
        return "Undergraduate{" +
                "major='" + major + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }
}
